.section .data
header: .ascii "HTTP/200.69.139.190"
file: .asciz"lala.txt"
bla: .ascii"\n"
array: .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
#formatString: .asciz "%s"
counter: .long 0
.section .bss
fd: .space 4
car: .space 16 
.section .text

.globl _start
_start:
   nop
   leal header, %edi
   leal header, %esi
   movl $27, %ecx
   cld
iterar:   lodsb  #load each character into al
   cmpb $'/', %al
   je equal
   jmp iterar


 equal:  movl $0, %ecx
         movl $0, %eax
         movl $0, %ebx
         addl $8, %esp
         lodsb  
# repeti:# cmpb $'\', %al
 #        cmpb $10, %al
  #        je is
        # movl %eax, car
         stosb
         lodsb
         stosb
         lodsb
         stosb
         lodsb
         stosb
         movl %esp, %eax
          
         call printf
           
         # addl $8, %esp
         #movb %al, %bh
        # lodsb
        # movb %al, %bl 
         
        # movw %bx, (%esp)
                       
        # lodsb
        # movb %al, %bh
         #lodsb
         #movb %al, %bl 
         #movw %bx, 2(%esp)
         
       #  movw  %bx ,(%esp) #200.
        
         # lodsl
        # movl %eax, 4(%esp) 
        #  lodsl
        # movl %eax, 8(%esp)
        #lodsl
        # movl %eax, 12(%esp)  
       #mov %al,2(%esp) #192.
         #lodsb
         

        # mov %al,3(%esp) #192.
        
         
        # mov %al,4(%esp) #192.
       
         

        # mov %al,5(%esp) #192.
        
         

         #mov %al,6(%esp) #192.
         
         
   



   
   
   
      
   #      lodsb
          
    #     jmp repeti 
     jmp fin    
              
         

              
        # incl %ecx
        # incl %ebx
        # incl %ebx
      # jmp repeti
       

 is: #     movl 12(%esp)     
         
                movl $5, %eax #mode=5 open
                  movl $file, %ebx #destiny file
                  movl $02101, %ecx #write mode
                  int $0x80  #s.o call
  movl %eax, fd   #move eax to fd to avoid losing fd
              
                #write in another file the data copied                 
	         movl $4, %eax  
                 movl fd, %ebx  #fd must be in ebx
		 movl $16, %edx #bytes to be copied 
		 movl %esp, %ecx #data to be copied
		 int $0x80 #s.0 call       


jmp fin


 fin:# pushw $car
     # pushl $formatString
     # call printf
      movl $1, %eax
      movl $0, %ebx
      int $0x80
